﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web.Security;
using EnCor.Security;

namespace EnCor.Aspnet.Security
{
    public class  AspnetTokenCredential : TokenCredential
    {
        private FormsAuthenticationTicket _Ticket;

        public AspnetTokenCredential(FormsAuthenticationTicket ticket)
        {
            _Ticket = ticket;
        }

        public override string Name
        {
            get { return _Ticket.Name; }
        }

        public FormsAuthenticationTicket Ticket
        {
            get
            {
                return _Ticket;
            }
        }

        public override string Token
        {
            get { return _Ticket.UserData; }
        }
    }
}
